export { cloneDeep } from "lodash";

export const compareDeep = (a, b) => {
  if (
    a === null ||
    typeof a !== "object" ||
    a === null ||
    typeof a !== "object"
  ) {
    return a === b;
  }
  const propsA = Object.getOwnPropertyDescriptors(a);
  const propsB = Object.getOwnPropertyDescriptors(b);
  if (Object.keys(propsA).length !== Object.keys(propsB).length) return false;
  return Object.keys(propsA).every((key) => compareDeep(a[key], b[key]));
};
